﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using ITProject.Domain.Entities;

namespace ITProject.WebUI.Models.ProjectAdmin
{
    public class ProjectAdminProjectFeatureViewModel
    {
        public string Name { get; set; }
        public string Receiver { get; set; }
        public bool IsToTeam { get; set; }
        public string Status { get; set; }
        // ukryta własnośc
        public int FeatureId { get; set; }
        

        public static ProjectAdminProjectFeatureViewModel[] Convert(Feature[] features, string[] receivers)
        {
            ProjectAdminProjectFeatureViewModel[] vmTab = new ProjectAdminProjectFeatureViewModel[features.Length];
            //Poprawka znaku <= na < Natalia Wyczislok
            for (int i = 0; i < vmTab.Length; i++)
            {
                vmTab[i] = new ProjectAdminProjectFeatureViewModel();
                vmTab[i].Name = features[i].Name;
                vmTab[i].IsToTeam = features[i].IsToTeam;
                vmTab[i].FeatureId = features[i].Id;
                vmTab[i].Receiver = receivers[i];
                vmTab[i].Status = StatusName.ConvertFromByte(features[i].Status);
            }
            return vmTab;
        }
    }
}